home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / exec / RCS / execlp.c,v < prev    next >
Encoding:
Text File  |  1989-01-28  |  3.5 KB  |  188 lines

  1. head     1.5;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.5
  10. date     89.01.27.21.09.39;  author rab;  state Exp;
  11. branches ;
  12. next     1.4;
  13.  
  14. 1.4
  15. date     88.07.28.17.42.45;  author ouster;  state Exp;
  16. branches ;
  17. next     1.3;
  18.  
  19. 1.3
  20. date     88.07.25.10.50.23;  author ouster;  state Exp;
  21. branches ;
  22. next     1.2;
  23.  
  24. 1.2
  25. date     88.07.11.15.40.45;  author ouster;  state Exp;
  26. branches ;
  27. next     1.1;
  28.  
  29. 1.1
  30. date     88.06.19.16.55.59;  author ouster;  state Exp;
  31. branches ;
  32. next     ;
  33.  
  34.  
  35. desc
  36. @@
  37.  
  38.  
  39. 1.5
  40. log
  41. @Fixed spelling of execlp for lint.
  42. @
  43. text
  44. @/* 
  45.  * execlp.c --
  46.  *
  47.  *    Source code for the execlp library procedure.
  48.  *
  49.  * Copyright 1988 Regents of the University of California
  50.  * Permission to use, copy, modify, and distribute this
  51.  * software and its documentation for any purpose and without
  52.  * fee is hereby granted, provided that the above copyright
  53.  * notice appear in all copies.  The University of California
  54.  * makes no representations about the suitability of this
  55.  * software for any purpose.  It is provided "as is" without
  56.  * express or implied warranty.
  57.  */
  58.  
  59. #ifndef lint
  60. static char rcsid[] = "$Header: /sprite/src/lib/c/exec/RCS/execlp.c,v 1.4 88/07/28 17:42:45 ouster Exp Locker: rab $ SPRITE (Berkeley)";
  61. #endif not lint
  62.  
  63. #include <stdlib.h>
  64. #include <varargs.h>
  65.  
  66. /*
  67.  * Library imports:
  68.  */
  69.  
  70. extern char **environ;
  71. extern execvp();
  72. extern char **_ExecArgs();
  73.  
  74.  
  75. /*
  76.  *----------------------------------------------------------------------
  77.  *
  78.  * execlp --
  79.  *
  80.  *    Execute a process, using the current environment variable,
  81.  *    instead of an explicitly-supplied one, and with arguments
  82.  *    in-line instead of in a separate array.  Also, imitate the
  83.  *    shell's actions in trying each directory in a search path
  84.  *    (given by the "PATH" environment variable).
  85.  *
  86.  * Results:
  87.  *    This procedure returns only if the exec fails.  In this case
  88.  *    the return value is -1.
  89.  *
  90.  * Side effects:
  91.  *    Overlays the current process with a new image.  See the man
  92.  *    page for details.
  93.  *
  94.  *----------------------------------------------------------------------
  95.  */
  96.  
  97. #ifndef lint
  98. int
  99. execlp(va_alist)
  100.     va_dcl            /* Name of file containing program to exec,
  101.                  * followed by one or more arguments of type
  102.                  * "char *", terminated by a zero argument. */
  103. {
  104.     char *name;
  105.     char **argv;
  106.     va_list args;
  107.  
  108.     va_start(args);
  109.     name = va_arg(args, char *);
  110.     argv = _ExecArgs(&args);
  111.     execvp(name, argv);
  112.     free((char *) argv);
  113.     return -1;
  114. }
  115. #else
  116. /* VARARGS2 */
  117. /* ARGSUSED */
  118. int
  119. execlp(file, arg1)
  120.     char *file;
  121.     char *arg1;
  122. {
  123.     return 0;
  124. }
  125. #endif
  126. @
  127.  
  128.  
  129. 1.4
  130. log
  131. @Add #ifdefs to generate correct lint library.
  132. @
  133. text
  134. @d17 1
  135. a17 1
  136. static char rcsid[] = "$Header: execlp.c,v 1.3 88/07/25 10:50:23 ouster Exp $ SPRITE (Berkeley)";
  137. d76 1
  138. a76 1
  139. execl(file, arg1)
  140. @
  141.  
  142.  
  143. 1.3
  144. log
  145. @Lint.
  146. @
  147. text
  148. @d17 1
  149. a17 1
  150. static char rcsid[] = "$Header: execlp.c,v 1.2 88/07/11 15:40:45 ouster Exp $ SPRITE (Berkeley)";
  151. d54 1
  152. a54 1
  153.     /* VARARGS0 */
  154. d72 11
  155. @
  156.  
  157.  
  158. 1.2
  159. log
  160. @When using varargs, only have a single argument in the list.
  161. @
  162. text
  163. @d17 1
  164. a17 1
  165. static char rcsid[] = "$Header: execlp.c,v 1.1 88/06/19 16:55:59 ouster Exp $ SPRITE (Berkeley)";
  166. d20 1
  167. @
  168.  
  169.  
  170. 1.1
  171. log
  172. @Initial revision
  173. @
  174. text
  175. @d17 1
  176. a17 1
  177. static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
  178. d53 1
  179. d55 4
  180. a58 4
  181. execlp(name, va_alist)
  182.     char *name;            /* Name of file containing program to exec. */
  183.     va_dcl            /* One or more arguments of type "char *",
  184.                  * terminated by a zero argument. */
  185. d60 1
  186. d65 1
  187. @
  188.